(wdired-get-filename): Change `(1+ beg)' to `beg' so
authorMartin Rudalics <rudalics@gmx.at>
Sat, 26 Jan 2008 17:17:52 +0000 (17:17 +0000)
committerMartin Rudalics <rudalics@gmx.at>
Sat, 26 Jan 2008 17:17:52 +0000 (17:17 +0000)
that the filename end is found even when the filename is empty.
Fixes error and spurious newlines when marking files for deletion.

lisp/wdired.el

index dff4c008d1b80ab35dab8cdb1a9a6034d2cf89ac..013e14ec7f748fbd36576a18f95b00e4ddc74afd 100644 (file)
@@ -323,7 +323,11 @@ non-nil means return old filename."
       (unless (eq beg end)
        (if old
            (setq file (get-text-property beg 'old-name))
-         (setq end (next-single-property-change (1+ beg) 'end-name))
+         ;; In the following form changed `(1+ beg)' to `beg' so that
+         ;; the filename end is found even when the filename is empty.
+         ;; Fixes error and spurious newlines when marking files for
+         ;; deletion.
+         (setq end (next-single-property-change beg 'end-name))
          (setq file (buffer-substring-no-properties (1+ beg) end)))
        (and file (setq file (wdired-normalize-filename file))))
       (if (or no-dir old)